<?php

namespace app\api\controller;

use app\api\model\Shopping;
use think\Controller;
use think\Request;

class Index extends Controller
{
    /**
     * cate 分类列表
     * shopping 购物车
     * all 总的数据
     */
    public function cate(Request $request)
    {

    }

    public function shopping(Request $request)
    {
        $isSelect =$request->isSelect;
        $data =(new Shopping())->gouwuche($isSelect);
        return $data;
    }

    public function shangping(Request $request)
    {
        if($request->isGet()){
            $data =(new Shopping())->shangping();
            return $data;
        }

        if($request->isPost()){
            $id =$request->id;
            $isSelect =0;
            $data = (new Shopping())->upd($id,$isSelect);
            return $data;
        }
    }
}
